package com.swak.boot.config.consistency.tcc;

import org.springframework.boot.context.properties.ConfigurationProperties;

import com.swak.Constants;
import com.swak.boot.config.jdbc.database.DataSourceProperties;

/**
 * Tcc 属性配置
 * 
 * @author DELL
 */
@ConfigurationProperties(prefix = Constants.TCC_PREFIX)
public class TccProperties {

	private String module;
	private int retryTimes = 3;

	/**
	 * multi : 是 dubbo 特有的模式，一个服务可以部署多个接口
	 * 各种参数可以配置在 @DubboReference 上，形成不同的调用客户端;
	 * Spring Cloud 不需要使用这种模型
	 */
	private String deployMode;

	/**
	 * 事务失效时间，秒
	 */
	private Long timeout = 90L;
	private String serializer = "kryo_pool";
	private Db db;

	public int getRetryTimes() {
		return retryTimes;
	}

	public void setRetryTimes(int retryTimes) {
		this.retryTimes = retryTimes;
	}

	public Long getTimeout() {
		return timeout;
	}

	public void setTimeout(Long timeout) {
		this.timeout = timeout;
	}

	public String getSerializer() {
		return serializer;
	}

	public void setSerializer(String serializer) {
		this.serializer = serializer;
	}

	public String getModule() {
		return module;
	}

	public void setModule(String module) {
		this.module = module;
	}

	public Db getDb() {
		return db;
	}

	public void setDb(Db db) {
		this.db = db;
	}

	public String getDeployMode() {
		return deployMode;
	}

	public void setDeployMode(String deployMode) {
		this.deployMode = deployMode;
	}

	/**
	 * 数据库配置
	 * 
	 * @author DELL
	 */
	public static class Db extends DataSourceProperties {
	}
}